   FROM golang:1.21 AS builder
   WORKDIR /app
   # 确保复制所有必要文件，包括go.mod和go.sum
   COPY api/ /app/
   # 如果需要，先初始化模块
   RUN if [ ! -f go.mod ]; then go mod init geekai; fi
   RUN cd /app && go build -o geekai-api
   
   FROM debian:bullseye-slim
   WORKDIR /app
   COPY --from=builder /app/geekai-api /app/
   COPY api/res/ /app/res/
   RUN mkdir -p /app/static
   EXPOSE 5678
   CMD ["/app/geekai-api"]